#include<iostream>
#include<string.h>
#define MAXNUM 19000
using namespace std;


int len , calc[MAXNUM] , num[MAXNUM];
struct Node
{
  Node* left_child , * right_child;
  int left , right;
  int color;
  void Init( int l , int r );
  void insert( int l , int r , int c );
  void Calcu();
} Tree[MAXNUM] , *Root = &Tree[0];

void Node::Init( int l , int r )
{
  left = l ;
  right = r;

  if ( l + 1 == r)
    {
      left_child = NULL;
      right_child = NULL;
      return ;
      }  
  int mid = ( 1 + r ) >> 1;
  left_child = &Tree[len++];
  right_child = &Tree[len++];
  left_child->Init( l , mid );
  right_child->Init( mid + 1 , r );
}


void Node::insert( int l , int r , int c)
{
  if ( color == c )
    return ;
  if ( l == left && r == right )
    {
      color = c;
      return ;
    }
  if ( color != -2 )
    {
      left_child->color = color;
      right_child->color = color;
    }
  int mid = ( left + right ) >> 1;
  color = -2 ;
  
  if ( mid <= l )
    {
      right_child->insert( l , r , c );
      return ;
    }
  
  if ( mid >= r )
    {
      left_child->insert( l ,r , c );
      return ;
    }

  left_child->insert( l , mid , c );
  right_child->insert( mid+1 , r , c );
  return ;

}

void Node::Calcu()
{
  if ( color == -1 )
    {
      return ;
    }
  if ( color != -2 )
    {
      for ( int i = left ; i <= right ; i++ )
	{
	  calc[i] = color;
	}
    }
  left_child->Calcu();
  right_child->Calcu();
}


int main()
{
  int n;
  int x1 , x2 , c;
  len = 1;
  cout<<"1"<<endl;
  Root->Init( 0 , MAXNUM -1 );
  while( cin >> n )
    {
      memset( calc , 0 ,sizeof(calc) );
      memset( num , 0, sizeof(num) ) ;
      Root->color = -1;

      for ( int i = 0;i < n ;i++ )
	{
	  cin >> x1 >> x2 >> c;
	  Root->insert( x1 , x2 , c );
	}
      Root->Calcu();
      for ( int i = 0;i < 10 ;i++)
	cout<<calc[i]<<"\t"<<endl;
    }


}

